Skip to content

Add Nix flake definition for reproducible builds#265

Merged
DeusData merged 1 commit intoDeusData:mainfrom
josephvoss:push-pwvtvsvklvtz
May 8, 2026
Merged

Add Nix flake definition for reproducible builds#265
DeusData merged 1 commit intoDeusData:mainfrom
josephvoss:push-pwvtvsvklvtz

Conversation

@josephvoss
Copy link
Copy Markdown
Contributor

Adds flake.nix to define how this package should be built on systems running nix. Also commit the flake.lock file to pin the specific dependencies at build time.

By default support aarch64 and x86_64 for macos and linux. Run the Make command directly because cc on Nix systems is a wrapper file and not a binary directly, so the file check in scripts/build.sh fails to identify the host architecture correctly.

Include lib2git as an optional dev shell dependency since it's detected by pkg-config in the build script to link to lib2git if it exists at build time.

Adds `flake.nix` to define how this package should be built on systems
running [nix][nix-link]. Also commit the `flake.lock` file to pin the
specific dependencies at build time.

By default support aarch64 and x86_64 for macos and linux. Run the Make
command directly because `cc` on Nix systems is a wrapper file and not a
binary directly, so the `file` check in `scripts/build.sh` fails to
identify the host architecture correctly.

Include lib2git as an optional dev shell dependency since it's detected
by `pkg-config` in the build script to link to `lib2git` if it exists at
build time.

[nix-link]: https://nixos.org/
@DeusData DeusData added the enhancement New feature or request label May 4, 2026
@DeusData
Copy link
Copy Markdown
Owner

DeusData commented May 8, 2026

Thanks @josephvoss — clean, focused PR with proper supply-chain hygiene (pinned nixpkgs commit + narHash, no random fetchurl, only standard nixpkgs build inputs). Verified:

  • Two new files only, fully opt-in — nix build / nix develop paths only; non-Nix users are unaffected
  • License declaration in flake.nix matches the repo's MIT LICENSE
  • The scripts/build.sh bypass is well-justified — cc as a Nix wrapper script breaks the file-based arch detection, and Nix stdenv already provides the correct compiler context
  • buildPhase calls the existing Makefile.cbm cbm target with -j$NIX_BUILD_CORES; no new build steps, no command injection surface
  • flake.lock lastModified resolves to 2026-04-14, consistent with the PR open date

Two small follow-ups I'll either drive or accept later — not blockers:

  • The hardcoded version = "0.6.0" will drift; could be templated from git describe or fed via an env var
  • flake.lock will need periodic refreshes for nixpkgs security patches (standard Nix maintenance)

Merging now.

@DeusData DeusData merged commit 0deb3b7 into DeusData:main May 8, 2026
DeusData added a commit that referenced this pull request May 9, 2026
Resolved conflict in Makefile.cbm: keep both TEST_STACK_OVERFLOW_SRCS
(from main, #217) and the new py_lsp test variables (TEST_SCOPE_SRCS,
TEST_TYPE_REP_SRCS, TEST_PY_LSP_SRCS, TEST_PY_LSP_BENCH_SRCS,
TEST_PY_LSP_STRESS_SRCS, TEST_PY_LSP_SCALE_SRCS) in ALL_TEST_SRCS.

Other auto-merged files: internal/cbm/extract_defs.c (PR #279),
tests/test_main.c (multiple suite registrations on each side).

Brings in 28 commits from main since the branch was forked at 8fbdb0f
(#207 thread safety): #208 decorator USAGE, #209 memory helpers, #210
refactor, #217 traversal stacks, #224 Svelte/Vue imports, #231
search_graph default limit, #243 path aliases, #249 GH Actions shell
injection, #251 incremental destructive overwrite, #257 temporal
properties, #265 Nix flake, #267-270/#289 dependabot, #273 Pine Script,
#278 AUR docs, #279 INHERITS edges, #281 get_architecture wiring +
follow-up, codeql revert.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants